import Vue from 'vue'
import App from './App'
import uView from '@/uni_modules/uview-ui'
Vue.use(uView)
import * as http from './common/http'
import * as utils from './common/utils'
import * as common from './common/common'
import store from './store'
import storage from 'common/storage'
import config from './config'

Vue.config.productionTip = false
Vue.prototype.$store = store
Vue.prototype.$storage = storage
Vue.prototype.$http = http
Vue.prototype.$utils = utils
Vue.prototype.$common = common
Vue.prototype.$config = config

Vue.prototype.goBack = function(delta = 1) {
	uni.navigateBack({ delta });
	return;
}

Vue.prototype.doCall = function(number) {
	uni.makePhoneCall({
		phoneNumber: number
	})
}

Vue.prototype.goTo = function(url, param={}) {
	let path = '/pages/' + url;
	uni.navigateTo({ url: path })
}

App.mpType = 'app'

const app = new Vue({
    ...App
})

app.$mount()
